﻿using UnityEngine;

public class WaitRespond : MonoBehaviour
{
    public int speed = 30;
    private float value;
    private float curtime;
    WaitLoadPanel waitLoad;

    void Awake()
    {
        curtime = Time.time;
        waitLoad = new WaitLoadPanel(gameObject);
        waitLoad.Circle1_sp.fillAmount = value;
    }

    void Update()
    {
        if ((Time.time - curtime) > 0.01f)
        {
            curtime = Time.time;
            value += Time.deltaTime * speed;
            if (value >= 1) { value = 0; }
        }
        waitLoad.Circle1_sp.fillAmount = value;
    }
}